package com.atguigu.d_period;

import java.time.LocalDate;
import java.time.Period;

public class Demo {
    public static void main(String[] args) {
        //创建年月日的时间间隔对象
        Period period = Period.between(LocalDate.of(1991, 1, 1),
                LocalDate.now());

        //P 32Y 9M 8D
        System.out.println("period = " + period);

        System.out.println("period.getDays() = " + period.getDays());//8
    }
}
